require("common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/personnel/personnel_rush" ], {
    "0545": function(e, t, n) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("4e1e"), t(n("66fd")), e(t(n("55bd")).default);
        }).call(this, n("543d").createPage);
    },
    "400a": function(e, t, n) {
        "use strict";
        var o = n("7516");
        n.n(o).a;
    },
    "4fc1": function(e, t, n) {
        "use strict";
        n.r(t);
        var o = n("953d"), a = n.n(o);
        for (var i in o) "default" !== i && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(i);
        t.default = a.a;
    },
    "55bd": function(e, t, n) {
        "use strict";
        n.r(t);
        var o = n("b043"), a = n("4fc1");
        for (var i in a) "default" !== i && function(e) {
            n.d(t, e, function() {
                return a[e];
            });
        }(i);
        n("400a");
        var c = n("f0c5"), r = Object(c.a)(a.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        t.default = r.exports;
    },
    7516: function(e, t, n) {},
    "953d": function(e, t, n) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var o = n("b00d"), a = {
                data: function() {
                    return {
                        graceFullLoading: !0,
                        currentCur: "personnel_rush",
                        bottomColor: "",
                        orderItemList: [],
                        emptyMsg: "没有待抢订单",
                        attach: "",
                        tempItem: [],
                        page: 1,
                        pageMore: 0,
                        loadingType: 0,
                        tempPageMore: 0,
                        userWxInfo: {},
                        isRush: 2,
                        lnglat: "",
                        tip: "请等待",
                        showBack: !1,
                        cardName: "次卡",
                        appid: ""
                    };
                },
                onLoad: function(t) {
                    this.appid = o.d;
                    var n = getCurrentPages();
                    this.showBack = n.length > 1;
                    var a = Date.now(), i = e.getStorageSync("peruploadtime"), c = e.getStorageSync("locationtype");
                    this.lnglat = e.getStorageSync("perlocation"), 1 != c && 2 != c ? this.getlocationtype() : 1 != c || this.lnglat && i && !(a > i + 18e4) ? 2 != c || this.lnglat ? this.loadData() : this.getlocationtype() : this.getLocation();
                },
                methods: {
                    getlocationtype: function() {
                        var t = this, n = this.$xSign.sign("v4personnel_getinfo");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4personnel_getinfo",
                            data: {
                                xgsign: n,
                                op: "getlocationtype"
                            },
                            success: function(n) {
                                var o = JSON.parse(t.$Decrypt(n.data.data)), a = o.locationtype;
                                t.lnglat = o.perlocation, e.setStorageSync("locationtype", a), 2 == a && e.setStorageSync("perlocation", t.lnglat);
                                var i = Date.now();
                                1 != a || t.lnglat && uploadTime && !(i > uploadTime + 18e4) ? 2 != a || t.lnglat ? t.loadData() : e.showModal({
                                    content: "请先选择您的固定地址",
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm && e.reLaunch({
                                            url: "personnel_center"
                                        });
                                    }
                                }) : t.getLocation();
                            },
                            fail: function(e) {
                                t.loadData();
                            }
                        });
                    },
                    showImgs: function(t, n) {
                        e.previewImage({
                            current: n,
                            urls: t
                        });
                    },
                    floatAdd: function(e, t) {
                        var n, o, a;
                        try {
                            n = e.toString().split(".")[1].length;
                        } catch (e) {
                            n = 0;
                        }
                        try {
                            o = t.toString().split(".")[1].length;
                        } catch (e) {
                            o = 0;
                        }
                        return a = Math.pow(10, Math.max(n, o)), Number(Math.round(e * a + t * a) / a);
                    },
                    getLocation: function() {
                        var t = this;
                        e.getSetting({
                            success: function(n) {
                                n.authSetting["scope.userLocation"] ? 0 == n.authSetting["scope.userLocation"] ? e.showModal({
                                    title: "提示",
                                    content: "点击右上角(...)设置打开位置权限,然后重新进入此页面",
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm ? e.reLaunch({
                                            url: "../index/index"
                                        }) : t.cancel && console.log("用户点击取消");
                                    }
                                }) : e.getLocation({
                                    type: "gcj02",
                                    success: function(n) {
                                        t.lnglat = n.longitude + "," + n.latitude;
                                        var o = Date.now();
                                        e.setStorageSync("perlocation", n.longitude + "," + n.latitude), e.setStorageSync("peruploadtime", o), 
                                        t.loadData();
                                    },
                                    fail: function(t) {
                                        e.showToast({
                                            title: "请开启手机位置定位(GPS),然后重新进入此页面",
                                            icon: "none"
                                        }), setTimeout(function() {
                                            e.reLaunch({
                                                url: "../index/index"
                                            });
                                        }, 2e3);
                                    }
                                }) : wx.authorize({
                                    scope: "scope.userLocation",
                                    success: function() {
                                        e.getLocation({
                                            type: "gcj02",
                                            success: function(n) {
                                                t.lnglat = n.longitude + "," + n.latitude;
                                                var o = Date.now();
                                                e.setStorageSync("perlocation", n.longitude + "," + n.latitude), e.setStorageSync("peruploadtime", o), 
                                                t.loadData();
                                            },
                                            fail: function(t) {
                                                e.showModal({
                                                    title: "提示",
                                                    content: "请开启手机位置定位(GPS),然后重新进入此页面",
                                                    showCancel: !1,
                                                    success: function(t) {
                                                        t.confirm ? e.reLaunch({
                                                            url: "../index/index"
                                                        }) : t.cancel && console.log("用户点击取消");
                                                    }
                                                });
                                            }
                                        });
                                    },
                                    fail: function() {
                                        e.showModal({
                                            title: "提示",
                                            content: "点击右上角(...)设置打开位置权限,然后重新进入此页面",
                                            showCancel: !1,
                                            success: function(t) {
                                                t.confirm ? e.reLaunch({
                                                    url: "../index/index"
                                                }) : t.cancel && console.log("用户点击取消");
                                            }
                                        });
                                    }
                                });
                            },
                            fail: function(e) {}
                        });
                    },
                    loadData: function() {
                        var t = this;
                        1 != this.pageMore ? (this.tip = "请等待", this.graceFullLoading = !0, setTimeout(function() {
                            var n = t.$xSign.sign("v4personnel_rush");
                            t.$xRequest.request({
                                url: "entry/wxapp/v4personnel_rush",
                                data: {
                                    page: t.page,
                                    op: "loadall",
                                    xgsign: n,
                                    lnglat: t.lnglat
                                },
                                success: function(n) {
                                    t.graceFullLoading = !1;
                                    var o = JSON.parse(t.$Decrypt(n.data.data));
                                    if (t.bottomColor = o.color, t.isRush = o.isrush, t.cardName = o.cardname, -1 != o.info) {
                                        if (0 == o.info) {
                                            if (o.itemlist) {
                                                var a = o.itemlist;
                                                t.tempItem = t.orderItemList.concat(a), t.orderItemList = t.tempItem, t.attach = o.attach, 
                                                a.length < o.pagesize ? (t.pageMore = 1, t.loadingType = 2) : t.loadingType = 0;
                                            }
                                            t.page++;
                                        } else t.tempPageMore = o.info, t.pageMore = t.tempPageMore, t.loadingType = 2;
                                        0 == t.orderItemList.length && (t.tip = "糟糕，订单被抢光了！");
                                    } else e.showModal({
                                        title: "温馨提示",
                                        content: n.data.message,
                                        showCancel: !1,
                                        success: function(t) {
                                            t.confirm && ("请重新填写申请资料!" == n.data.message ? e.reLaunch({
                                                url: "../editsmjz/editsmjz"
                                            }) : e.reLaunch({
                                                url: "../index/index"
                                            }));
                                        }
                                    });
                                }
                            });
                        }, 300)) : this.graceFullLoading = !1;
                    },
                    toRush: function(t) {
                        var n = this;
                        if (e.showLoading({
                            title: "抢单中",
                            mask: !0
                        }), "wx5a67ffb91ef175cb" == this.appid || "wxcaad2fca5f5aeba1" == this.appid) var o = 1; else o = 2;
                        var a = this.$xSign.sign("v4personnel_rush");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4personnel_rush",
                            data: {
                                oid: t,
                                op: "rush",
                                xgsign: a,
                                onlyone: o
                            },
                            success: function(t) {
                                e.hideLoading(), t.data, 0 == JSON.parse(n.$Decrypt(t.data.data)).info ? e.showModal({
                                    title: "恭喜您",
                                    content: "抢单成功",
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm && e.reLaunch({
                                            url: "/xg_o2o/personnel/personnel_order"
                                        });
                                    }
                                }) : e.showModal({
                                    title: "抢单失败",
                                    content: "该订单已被他人抢单，请加快手速",
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm && e.reLaunch({
                                            url: "/xg_o2o/personnel/personnel_rush"
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                e.hideLoading(), e.showModal({
                                    title: "抢单失败",
                                    content: t.data.message,
                                    showCancel: !1,
                                    success: function(e) {
                                        e.confirm && n.loadData();
                                    }
                                });
                            }
                        });
                    }
                },
                computed: {
                    style: function() {
                        var t = this.$systemInfo.info(), n = t.windowHeight - t.iPhoneXBottomHeightPx - t.statusBarHeight - 44 - e.upx2px(100);
                        return "height:".concat(n, "px;");
                    }
                }
            };
            t.default = a;
        }).call(this, n("543d").default);
    },
    b043: function(e, t, n) {
        "use strict";
        n.d(t, "b", function() {
            return a;
        }), n.d(t, "c", function() {
            return i;
        }), n.d(t, "a", function() {
            return o;
        });
        var o = {
            gracePage: function() {
                return n.e("graceUI/components/gracePage").then(n.bind(null, "1915"));
            },
            graceDialog: function() {
                return n.e("graceUI/components/graceDialog").then(n.bind(null, "8d15"));
            },
            graceEmptyNew: function() {
                return n.e("graceUI/components/graceEmptyNew").then(n.bind(null, "fb2f"));
            },
            divider: function() {
                return n.e("components/divider/divider").then(n.bind(null, "bdb7"));
            },
            graceLoading: function() {
                return n.e("graceUI/components/graceLoading").then(n.bind(null, "93a5"));
            },
            xgTabbarPer: function() {
                return n.e("components/xgTabbarPer/xgTabbarPer").then(n.bind(null, "534a"));
            }
        }, a = function() {
            var e = this, t = (e.$createElement, e._self._c, 0 !== e.orderItemList.length ? e.__map(e.orderItemList, function(t, n) {
                return {
                    $orig: e.__get_orig(t),
                    m0: 1 != e.isRush || t.isdemand > 0 || 1 == t.isadminadd && 2 == t.paytype || 1 == t.isadminadd && 3 == t.paytype || 0 != t.isdemand || 0 != t.isadminadd ? null : e.floatAdd(t.marketprice, t.totalprice)
                };
            }) : null);
            e.$mp.data = Object.assign({}, {
                $root: {
                    l0: t
                }
            });
        }, i = [];
    }
}, [ [ "0545", "common/runtime", "common/vendor" ] ] ]);